<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue"></script>

</head>
<body>
                <div id="app">
                  <mycomponet1>
                    <div>我是内容</div>
                  </mycomponet1>
                </div>
                <script>
                  Vue.component('mycomponet1', {
                    template: `
                      <div>
                        <h2>我是标题</h2>
                        <slot></slot>
                      </div>
                    `
                  })
              
                  //根组件
                  var app = new Vue({
                    el: '#app'
                  })
                </script>
</body>
</html>